#include "ImageRessource.hpp"


ImageRessource::ImageRessource(std::string filename) : AbstractRessource<sf::Image>(filename)
{
}

void ImageRessource::LoadRessource()
{
	if(m_loaded == false)
	{
		m_ressource = new sf::Image;

		m_loaded = m_ressource->LoadFromFile(m_filename);
	}

}

void ImageRessource::UnloadRessource()
{
	delete m_ressource;
	m_ressource = NULL;
	m_loaded = false;
}

unsigned int ImageRessource::MaximunSize()
{
	GLint gl_size;

	glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_size);

	return static_cast<unsigned int>(gl_size);

}


ImageRessource::~ImageRessource()
{
	UnloadRessource();
}

void ImageRessource::SetSmoothImage(bool Smooth)
{
    m_ressource->SetSmooth(Smooth);
}
